package com.han.spider.cloudmeeting;

import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

import static com.han.spider.cloudmeeting.UserPropertyReader.getUserList;

/**
 * @Author: Hanjiafeng
 * @Date: 2020/6/28
 * @Desc:
 */
@Slf4j
public class Main {
    public static void main(String[] args) throws IOException {
        ThreadPoolExecutor executor = new ThreadPoolExecutor(200, 500, 10, TimeUnit.MINUTES, new ArrayBlockingQueue<>(1000), r -> new Thread(r, "create"));
        List<String[]> list = getUserList("E:/meeting/玖润.txt");
        for (String[] ss : list) {
            executor.execute(new MeetingPool(ss[0], ss[1]));
            try{
                Thread.sleep(1000 * 60);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        executor.shutdown();
    }

    private void createMeeting(){

    }
}
